home *** CD-ROM | disk | FTP | other *** search
/ Carousel / CAROUSEL.cdr / mactosh / util / simulare.sit / Simula 4.07 Reference / card_34303.txt < prev    next >
Text File  |  1989-05-02  |  2KB  |  84 lines

  1. -- card: 34303 from stack: in.07 Reference
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 13647
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 00
  10. -- high flags: 0002
  11. -- rect: left=289 top=54 right=261 bottom=474
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 0
  15. -- font id: 3
  16. -- text size: 9
  17. -- style flags: 0
  18. -- line height: 12
  19. -- part name: 
  20.  
  21.  
  22. -- part 2 (button)
  23. -- low flags: 00
  24. -- high flags: A004
  25. -- rect: left=97 top=288 right=310 bottom=144
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 1
  29. -- font id: 0
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: inner
  34. ----- HyperTalk script -----
  35. on mouseUp
  36.   go to card id 2130
  37. end mouseUp
  38.  
  39.  
  40.  
  41.  
  42. -- part contents for background part 1
  43. ----- text -----
  44.  
  45. An instance of a class is called an object. 
  46. Objects can be created dynamically and 
  47. are removed by the garbage collector 
  48. when no longer accessible.
  49.  
  50. Objects are created with the "new" constructor. 
  51. The parameters of all the prefix classes must 
  52. be supplied in order, starting with parameters 
  53. of the outermost prefix class.
  54.  
  55. In the default case the bodies of all the classes 
  56. are executed in order, also starting with the 
  57. outermost prefix class, but this can be 
  58. changed with the "inner" mechanism.
  59.  
  60.  
  61.  
  62. -- part contents for background part 2
  63. ----- text -----
  64. Object creation
  65.  
  66. -- part contents for card part 1
  67. ----- text -----
  68. class  Car(YearMade); 
  69.       Integer YearMade;
  70. begin
  71.     text Plate;
  72.     Plate:-Register(this Car);
  73. end --- Car ---;
  74.  
  75. Car class Lorry(MaxLoad); 
  76.      Integer MaxLoad;
  77. begin
  78.      RegisterTIR(this Car,Plate); 
  79. end --- Lorry ---;
  80.  
  81. new Lorry(1989,1200);
  82. ! -- the lorry executes:
  83.  Register  first, then RegisterTIR -- ;
  84.